package aybolit.core.objects.model;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Collection;

/**
 * Created by IntelliJ IDEA.
 * User: Vadim
 * Date: 13.03.13
 * Time: 16:57
 * To change this template use File | Settings | File Templates.
 */
@Entity
public class Status implements Serializable {
    private int statusId;

    @Column(name = "status_id")
    @Id
    public int getStatusId() {
        return statusId;
    }

    public void setStatusId(int statusId) {
        this.statusId = statusId;
    }

    private String name;

    @Column(name = "name")
    @Basic
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    private String note;

    @Column(name = "note")
    @Basic
    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    private int deleted;

    @Column(name = "deleted")
    @Basic
    public int getDeleted() {
        return deleted;
    }

    public void setDeleted(int deleted) {
        this.deleted = deleted;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Status status = (Status) o;

        if (deleted != status.deleted) return false;
        if (statusId != status.statusId) return false;
        if (name != null ? !name.equals(status.name) : status.name != null) return false;
        if (note != null ? !note.equals(status.note) : status.note != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = statusId;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (note != null ? note.hashCode() : 0);
        result = 31 * result + deleted;
        return result;
    }

    private Collection<Beds> bedsesByStatusId;

    @OneToMany(mappedBy = "statusByBedStatusId")
    public Collection<Beds> getBedsesByStatusId() {
        return bedsesByStatusId;
    }

    public void setBedsesByStatusId(Collection<Beds> bedsesByStatusId) {
        this.bedsesByStatusId = bedsesByStatusId;
    }

    private Collection<Chambers> chambersesByStatusId;

    @OneToMany(mappedBy = "statusByChamberStatusId")
    public Collection<Chambers> getChambersesByStatusId() {
        return chambersesByStatusId;
    }

    public void setChambersesByStatusId(Collection<Chambers> chambersesByStatusId) {
        this.chambersesByStatusId = chambersesByStatusId;
    }

    private Collection<Departments> departmentsesByStatusId;

    @OneToMany(mappedBy = "statusByDepartamentStatus")
    public Collection<Departments> getDepartmentsesByStatusId() {
        return departmentsesByStatusId;
    }

    public void setDepartmentsesByStatusId(Collection<Departments> departmentsesByStatusId) {
        this.departmentsesByStatusId = departmentsesByStatusId;
    }

    private Collection<Hospitales> hospitalesesByStatusId;

    @OneToMany(mappedBy = "statusByStatusId")
    public Collection<Hospitales> getHospitalesesByStatusId() {
        return hospitalesesByStatusId;
    }

    public void setHospitalesesByStatusId(Collection<Hospitales> hospitalesesByStatusId) {
        this.hospitalesesByStatusId = hospitalesesByStatusId;
    }

    private Collection<Healing> healingsByStatusId;

    @OneToMany(mappedBy = "statusByStatusId")
    public Collection<Healing> getHealingsByStatusId() {
        return healingsByStatusId;
    }

    public void setHealingsByStatusId(Collection<Healing> healingsByStatusId) {
        this.healingsByStatusId = healingsByStatusId;
    }
}
